1. Field of the Invention
The present invention relates to transmission and reception of signals between devices (nodes) attached to a computer over a serial bus such as the IEEE-1394 bus specified according to the IEEE-1394 Standard for a High Performance Serial Bus (or IEEE Std 1394-1995).
2. Description of the Related Art
The IEEE 1394 standard specifies protocols for the transmission and reception of various control signals and communication signals between peripheral devices of a computer such as printers, hard disk drives, scanners, digital cameras (nodes) at different layers of each node connected to a serial bus. For the physical layer of each node, a procedure is specified for bus initialisation and determination of bus ownership. This procedure is described by a state machine having four broadly classified functions. The bus initialisation procedure consists of three network initialisation processes (Bus Reset process, Tree ID process, and Self ID process) and a Normal process (for normal communication between nodes).
For each of these processes a number of states are defined. For Bus Reset process, states R0 (Reset Start) and R1 (Reset Wait) are defined, and for Tree ID process states T0 (Tree ID start), T1 (Child Handshake), T2 (Parent Handshake) and T3 (Root Contention) are defined. Similarly, five states are defined for Self ID process, including S0 (Self ID Start), S1 (Self ID Grant), S2 (Self ID Receive), S3 (Send Speed Capabilities) and S4 (Self ID Transmit), and six states are defined for Normal process, including A0 (Idle), A1 (Request), A2 (Grant), TX (Transmit), RX (Receive) and PH (PHY Response). The present invention is concerned with Tree ID and Normal processes. The sequences of line states that occur during a Tree ID process and a Normal process are respectively shown in FIGS. 1 and 2.
In FIG. 1, a Tree ID process between nodes A and B is shown. This process is a handshaking process which begins with the node B asserting a Parent Notify state on the serial bus. Node A, on detecting the Parent Notify state, asserts a child notify state on the serial bus. In response, the node B deasserts the parent notify state and returns the bus to Idle state. With this process, the node A is determined as a parent of node B and the node B as a child of node A.
FIG. 2 shows the essential states of a state machine of a node during Normal process which are concerned with the present invention. The node has each connected port labelled parent if it is pointing towards the root node that is authorised to assign the ownership of the serial bus and labelled child if it is pointing towards a node (i.e., child) located on one side of the node that is opposite to the root node. State A0 indicates the Idle state of the node in which it drives an idle signal to the serial bus. If a node, except for the root node, is in the Idle state and receives a Request signal from its child port, it changes to state A1. If the root node receives a Request signal from its child port, it changes from Idle state to state A2 (=Grant). If a node, regardless of its type, receives a Data Prefix (i.e., indicating the start of transmission of data) during state A0, it changes to state RX in which it receives packets.
If the node is in state A1 and receives a Grant signal from its parent port, it changes to state A0 (=Idle) if a Request signal from its child port is cancelled or changes to state A2 (=Grant) if such a Request signal persists. If the node receives a Data Prefix from the parent port, it recognises that a Request signal from its child port is cancelled and changes to state RX in order to receive packets from the parent port. If a node is in state A1 (=Request) to transmit packets and receives a Grant signal from the parent port, it changes to state TX in order to transmit packets.
When the node is in state A2 (=Grant), it changes to state A0 if it receives a Request cancel signal from its child port, or changes to state RX if it receives a Data Prefix signal. If the node is in state RX, it changes to state A0 if it receives an Idle signal from the port from which packets are being received. If the node is in state TX, it returns to state A0 at the end of transmission of packets.
FIG. 3 shows various line states of nodes A and B interconnected by shielded twisted pairs TPA and TPB (with a maximum length of 4.5 meters) when they exchange arbitration signals to gain bus ownership using data-strobe encoding. The twisted pairs are reversed at the midpoint of the cable so that the TPA and TPB viewed from node A are the TPB and TPA viewed from node B. During initial state, node A is signalling an Idle state by driving an Idle signal to both TPA and TPB, which is indicated as a line state (TPA, TPB)=(Z, Z).
Table 1 indicates a contention state in which the Request signal (Z, 0) from node A and the Idle signal (Z, Z) occur simultaneously on the cable and the line state of the cable as viewed from node B changes to a differential state (0, Z). Recognising that the node A has transmitted a Request signal, the node B responds to it with a Grant signal to give the bus ownership to node A. Table 2 indicates another contention state in which node A sends a Request signal (Z, 0) while node B sends a Grant signal (Z, 0). The line state of the cable viewed from node A changes to a differential state (0, 0). Node A recognises that the ownership of the bus is granted and transmits a Data Prefix signal (0, 1) that precedes subsequent packets. Table 3 indicates another contention state in which node A asserts a Data Prefix signal (0, 1) and node B asserts a Grant signal (Z, 0). Node B interprets the resulting differential line state (1, 0) as a Data Prefix signal and deasserts the Grant signal in order to receive packets from node A. In Table 4, node 1 asserts a Data Prefix signal (0, 1) and node B is in Idle state (Z, Z). Node 1 sees the differential line state (0, 1). Since this line state is the same as one that node A has sent, the node A does not respond to it. In this way, nodes attached to an IEEE-1394 serial bus exchanges information in a half-duplex mode.
Consider a three-node network of FIGS. 4A to 4D in which a node 2 is shown as the root node authorised to grant bus ownership. If nodes 1 and 3 assert Request signals R1 and R2 on child ports “0” and “2” of root node 2 as shown FIG. 4A and root node 2 receives R1 earlier than R2, the root node grants bus ownership to node 1 by asserting a Grant signal G3 on the child port “0” and informs node 2 of the fact that its request is denied by asserting a Data Prefix signal D3 on the child port “2” as shown in FIG. 4B. Node 1 sends a Data Prefix signal D4 which is followed by a packet P5 (FIG. 4C). Root node 2, on receiving the packet P5, successively transmits a Data Prefix D6 to node 3 before sending the packet P5 as a packet P7 (FIG. 4D). If the distance between nodes 2 and 3 are relatively short, it is likely that node 3 has deasserted the Request signal R2 before the packet P7 arrives, and hence no contention arises between R2 and P7.
In more detail, when the node 1 asserts the Request signal R1, the root node 2 responds with the Grant signal G3 (FIG. 5A). On receiving the Grant signal G3, the node 1 deasserts the Request signal R1 and transmits Data Prefix D4. Root node 2 then deasserts the Grant signal G3 to enter a packet receiving mode. Note that the length of the Grant signal G3 from root node 2 is equal to the turnaround time between nodes 1 and 2. The length of Data Prefix D4 is greater than the turnaround time to prevent contention between packet P5 and Grant signal G3. When the node 3 asserts the Request signal R2, the root node 2 is asserting the Data Prefix D3 (FIG. 5B). On receiving the Data Prefix D3, the node 3 deasserts the Request signal R2. In order for a packet from the root node 2 to be transmitted without encountering Request signal R2, it is necessary that the length of Data Prefix D3 is greater than the turnaround time between nodes 2 and 3. If these nodes are spaced apart a distance of 4.5 meters, the turnaround time is approximately 50 nanoseconds. Since the minimum length of the Data Prefix is specified as 140 nanoseconds, no contention occurs between the packet from root node 2 and Request signal P2 from node 3.
Development efforts for longer bus-length transmission have recently culminated as the P1394b Draft Standard for a High Performance Serial Bus (Supplement Draft 0.17 Apr. 23, 1999). The draft standard provides protocol for serial transmission of data on a full-duplex mode between nodes attached to an optical fiber or unshielded twisted pairs (UTP) to ensure full-duplex communication over a length longer than 4.5 meters, using 8B/10B block codes. The newly developed protocol may be used in combination with the current protocol of data-strobe codes. As one example, a four-node network is shown in FIG. 6, in which the distance between nodes 3 and 4 is greater than 4.5 meters and hence they are interconnected by 8B/10B ports, each including (as shown in FIG. 7) an 8B/10B encoder 11 and a parallel-to-serial converter 12 and a serial-to-parallel converter 13 and an 8B/10B decoder 14.
However, there is a likelihood of a situation in which a Request signal would remain asserted (i.e., not cancelled) in the longer-than-4.5-meter bus section and contend with other signals. As shown in FIG. 8A, assume that node 1 successively transmits a Data Prefix signal and a packet after it has acquired bus ownership and node 4 sends a Request to node 3 to request the bus ownership. The Data Prefix and the packet from node 1 are retransmitted by root node 2 to node 3, where they are further retransmitted to node 4. When the node 4 receives the Data Prefix signal from node 3, it deasserts the Request signal (FIG. 8B). However, if the data length of the packet from node 3 to node 4 is shorter than the distance between nodes 3 and 4, the node 3 will receive, after it has retransmitted the packet to node 4, the Request signal which remains asserted as a “ghost” between nodes 3 and 4. This ghost Request signal is received by node 3 and retransmitted to root node 2. Root node 2 responds to this ghost Request with a Grant signal as shown in FIG. 8C, and the node 4 responds to the packet from node 1 with an acknowledgment packet. After transmitting a Request signal, the node 3 enters a standby mode waiting for a Grant signal from its parent port. Since the node 3 is in the standby mode, the arrival of the acknowledgment packet from node 4 at its child port cannot enable the node 3 to change state and hence the acknowledgment packet is not received by node 3. As a result, the node 1 cannot receive acknowledgment from the node 4 for receipt of a packet even if it is properly received. Transitions of state machines of nodes 3 and 4 during a Normal process are shown in detail in FIG. 9. When a Data Prefix (DP) signal from node 2 arrives on node 3, the node 3 is in state RX, while the node 4 is in state A1 asserting a Request signal. Node 3 then retransmits the DP message and the following packet (PKT) and Date End (DE) message to node 4 and then momentarily changes to state A0 (=idle). Since the 8B/10B port of node 3 is still receiving the Request signal from node 4 after it has retransmitted the DE message to node 4, the node 3 changes to state A1 (=Request) following a momentary change to state A0. On the other hand, the node 4 receives the retransmitted Data Prefix signal (DP) from node 3 and deasserts the Request signal and changes to state RX to enter a packet receive mode for receiving DP, PKT and DE. Since the node 3 is in state A1 (=Request) at the instant the Request signal from node 4 is terminated, the Request signal remains as a ghost and propagated from node 3 to root node 2. Meanwhile, the node 4 receives the DE message from node 3 and changes to state TX to send a DP signal and an acknowledgment (ACK) message and a DE message to node 3. Node 3 is in state A1, waiting for a Grant signal from its parent port. If the ACK message arrives on node 3 in state A1, the state machine of node 3 cannot recognise the arrival of the ACK message.